# -*- coding: utf-8 -*-
import platform

###########################################################################
## Python code generated with wxFormBuilder (version Oct 26 2018)
## http://www.wxformbuilder.org/
##
## PLEASE DO *NOT* EDIT THIS FILE!
###########################################################################

import wx
import wx.xrc
import psutil
import sys

from wheel.macosx_libfile import CPU_TYPE_ARM64


###########################################################################
## Class MyFrame
###########################################################################

class MyFrame(wx.Frame):

    def __init__(self, parent):
        wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=wx.EmptyString, pos=wx.DefaultPosition,
                          size=wx.Size(500, 300), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)

        self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)

        bSizer = wx.BoxSizer(wx.VERTICAL)

        bSizer.Add((0, 0), 1, wx.EXPAND, 5)

        bSizer1 = wx.BoxSizer(wx.VERTICAL)

        bSizer2 = wx.BoxSizer(wx.HORIZONTAL)

        bSizer2.Add((0, 0), 1, wx.EXPAND, 5)

        self.m_staticText1 = wx.StaticText(self, wx.ID_ANY, u"MyLabel", wx.DefaultPosition, wx.Size(100, -1), 0)
        self.m_staticText1.Wrap(-1)

        bSizer2.Add(self.m_staticText1, 0, wx.ALL, 5)

        self.m_staticText2 = wx.StaticText(self, wx.ID_ANY, u"MyLabel", wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_staticText2.Wrap(-1)

        bSizer2.Add(self.m_staticText2, 0, wx.ALL, 5)

        bSizer2.Add((0, 0), 1, wx.EXPAND, 5)

        bSizer1.Add(bSizer2, 1, wx.EXPAND, 5)

        bSizer3 = wx.BoxSizer(wx.HORIZONTAL)

        bSizer3.Add((0, 0), 1, wx.EXPAND, 5)

        self.m_staticText3 = wx.StaticText(self, wx.ID_ANY, u"MyLabel", wx.DefaultPosition, wx.Size(100, -1), 0)
        self.m_staticText3.Wrap(-1)

        bSizer3.Add(self.m_staticText3, 0, wx.ALL, 5)

        self.m_staticText4 = wx.StaticText(self, wx.ID_ANY, u"MyLabel", wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_staticText4.Wrap(-1)

        bSizer3.Add(self.m_staticText4, 0, wx.ALL, 5)

        bSizer3.Add((0, 0), 1, wx.EXPAND, 5)

        bSizer1.Add(bSizer3, 1, wx.EXPAND, 5)

        bSizer4 = wx.BoxSizer(wx.HORIZONTAL)

        bSizer4.Add((0, 0), 1, wx.EXPAND, 5)

        self.m_staticText5 = wx.StaticText(self, wx.ID_ANY, u"MyLabel", wx.DefaultPosition, wx.Size(100, -1), 0)
        self.m_staticText5.Wrap(-1)

        bSizer4.Add(self.m_staticText5, 0, wx.ALL, 5)

        self.m_staticText6 = wx.StaticText(self, wx.ID_ANY, u"MyLabel", wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_staticText6.Wrap(-1)

        bSizer4.Add(self.m_staticText6, 0, wx.ALL, 5)

        bSizer4.Add((0, 0), 1, wx.EXPAND, 5)

        bSizer1.Add(bSizer4, 1, wx.EXPAND, 5)

        bSizer.Add(bSizer1, 1, wx.EXPAND, 5)

        bSizer.Add((0, 0), 1, wx.EXPAND, 5)

        self.SetSizer(bSizer)
        self.Layout()

        self.Centre(wx.BOTH)
        self.GetSysInfo()


    def __del__(self):
        pass


    def GetSysInfo(self):
        if (sys.platform == "win32"):
            import wmi
            Wmi = wmi.WMI()

            OS = Wmi.Win32_OperatingSystem()[0]
            CPU = Wmi.Win32_Processor()[0]
            CS = Wmi.Win32_ComputerSystem()[0]

            print(OS)
            print(CPU)
            print(CS)

            # self.m_staticText1.SetLabel("计算机名称")
            print(CS.name)
            # self.m_staticText1.SetLabel("计算机操作系统")
            print(platform.system())
            # self.m_staticText1.SetLabel("域名")
            print(CS.Domain)
            # self.m_staticText1.SetLabel("系统制造商")
            print(CS.Manufacturer)
            # self.m_staticText1.SetLabel("系统信号")
            print(CS.Model)
            # self.m_staticText1.SetLabel("处理器数")
            print(str(psutil.cpu_count()))
            # self.m_staticText1.SetLabel("处理器")
            print(CS.)
            # self.m_staticText1.SetLabel("内存")
            print(str(int(CS.TotalMemery)//1024*2)+u"MB")
            # self.m_staticText1.SetLabel("剩余物理内存")
            print(str(int(CS.FreeMemory) // 1024 * 2) + u"MB")



if __name__ == "__main__":
    app = wx.App()
    frame = MyFrame(None)
    frame.Show(True)
    app.MainLoop()
